


using System;

namespace MyUtility.Utility
{
    public static class ForTool
    {
        /// <summary>
        /// 对枚举进行遍历
        /// </summary>
        /// <param name="type"> 枚举类型 </param>
        /// <param name="callback"> 遍历回调 </param>
        public static void EnumForeach(Type type, Action<Type> callback)
        {
            foreach (Type eobj in Enum.GetValues(type))
            {
                callback?.Invoke(eobj);
            }
        }
    }
}